home *** CD-ROM | disk | FTP | other *** search
-
- XDEF StrFirstNum
-
- ; StrFirstNum() - Finds first number ("0"-"9") in string in A0.
-
- ; Result:
- ; D0 = 0 if character was not found, or the position where found.
-
- StrFirstNum:
- cmp.b #"0",(a0)
- bcc.b .Check
- addq.l #1,a0
- tst.b (a0)
- bne.b StrFirstNum
- moveq #0,d0
- rts
-
- .Check:
- cmp.b #"9",(a0)
- bls.b .Found
- addq.l #1,a0
- bne.b StrFirstNum
-
- .Found:
- move.l a0,d0
- rts
-